//
//  QMainFootView.m
//  QoilPublic
//
//  Created by 杨凯 on 16/7/1.
//  Copyright © 2016年 杨凯. All rights reserved.
//

#import "QMainFootView.h"

@interface QMainFootView()

@end
@implementation QMainFootView


- (IBAction)buttonAction:(UIButton *)sender {
    
    UIButton *button = (UIButton *)sender;

    if (self.footBlock) {
        _footBlock(button.tag);
    }
}

- (void)awakeFromNib{

    [super awakeFromNib];
    
    self.addOilButton.tag = 1;
    [self.addOilButton whiteStyle];
    self.cMoneyButton.tag = 2;
    [self.cMoneyButton whiteStyle];
    self.callButton.tag = 3;
    self.mySelfButton.tag = 4;
    self.scanCodeButton.tag = 5;
    self.oneButton.tag = 6;
    [self.oneButton whiteStyle];
    self.twoButton.tag = 7;
    [self.twoButton whiteStyle];
    self.threeButton.tag = 8;
    [self.threeButton whiteStyle];
    self.fourButton.tag = 9;
    [self.fourButton whiteStyle];
    self.fiveButton.tag = 10;
    [self.fiveButton whiteStyle];

    
    self.lineImageView.backgroundColor = [QColorUtility defaultLineColor];
    self.lineImageConstr.constant = 0.5;
    
    self.bacView.layer.borderWidth = 0.5;
    self.bacView.layer.borderColor = [QColorUtility defaultLineColor].CGColor;
    
    if(iphone6Plus_5_5){
        self.buttonHeightConstr.constant = 200;
        self.iconWConstr.constant = 100;
        self.iconHConstr.constant = 100;
        self.bottomButtonConstr.constant = 55;
    }else if(iphone6_4_7){
       self.buttonHeightConstr.constant = 187;
        self.iconWConstr.constant = 90;
        self.iconHConstr.constant = 90;
        self.bottomButtonConstr.constant = 50;
    }else if(iphone5x_4_0){
        self.buttonHeightConstr.constant = 160;
        self.iconWConstr.constant = 80;
        self.iconHConstr.constant = 80;
        self.bottomButtonConstr.constant = 45;
    }else if (iphone4x_3_5){
      self.buttonHeightConstr.constant = 140;
        self.iconWConstr.constant = 60;
        self.iconHConstr.constant = 60;
        self.bottomButtonConstr.constant = 45;
    }
}

@end
